package priv.stones.reflect;

import java.util.Date;

/**
 * @Author: Stones
 * @Description:
 * @Date: 2017/9/26 9:51
 */
public class Reflect1 {

    public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
        Date date = new Date();
        System.out.println(date);
        Class cls = date.getClass();
        System.out.println(cls.getName());
        System.out.println(cls.getSimpleName());
        System.out.println(date.getClass().getName());


        Date date1 = (Date) cls.newInstance();
        System.out.println(date1);


        Class cls1 = Date.class;
        System.out.println(cls1.getName());
        System.out.println(cls1.getSimpleName());


        Class cls2 = Class.forName("java.util.Date");
        System.out.println(cls2.getName());
        System.out.println(cls2.getSimpleName());

    }

}
